#ifndef PANELIMAGE_H
#define PANELIMAGE_H

#include "imageclickable.h"
class Cadre;
class Image : public ImageClickable
{
    Q_OBJECT
public:
    Image(const QString & fichier = QString("ressources/fond.png"));
    virtual void loadImage(const QString & fichier);
    virtual void setCadre(Cadre * cadre);
    void zoom(double x);
    QPoint posRect()const { return _posRect;}
    virtual ~Image();
protected:
    virtual void recadrage();

signals:

protected slots:
   void onMouseClicked(QMouseEvent * event);
   void onMouseMove(QMouseEvent * event);
   void onMouseDoubleClicked(QMouseEvent * event);
   void onDeselection(){selection = false;}
protected:
    double _facteurZoom;
    QPixmap* _source;
    QPixmap* _destination;
    QPoint _posRect;
    QPoint _mousePos;
    Cadre * _cadre;
public:
    bool selection;
    
};

#endif // PANELIMAGE_H
